<?php
header('content-type:text/html;charset=utf-8');

//设置时区
date_default_timezone_set('PRC');

//格式化当前时间
//echo date('y/m/d');

//获得当前时间的时间戳
//$x = time();
//echo '<br /> ';

//将指定的时间戳格式化
//echo date('y/m/d',$x);

//获得当前时间的微秒数
//$y = microtime(true);
////
//echo number_format($y,12);


function foo($one){
	static $x;
	if($one=='start'){
		$x = microtime(true);
	}
	if($one=='end'){
		$a = microtime(true);
		$str = $a-$x;
		return $str;
	}
	
	
	
	
	
	
}
echo foo('start');

echo '<h2>1231321321321321</h2>';
echo '<h2>1231321321321321</h2>';
echo '<h2>1231321321321321</h2>';
echo '<h2>1231321321321321</h2>';
echo '<h2>1231321321321321</h2>';
echo '<h2>1231321321321321</h2>';
echo '<h2>1231321321321321</h2>';
echo '<h2>1231321321321321</h2>';

echo foo('end');
